package com.yhd;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class Executor {

    public <T> T query(String sql, Object[] parameters)throws Exception {
        Connection conn= JDBCUtils.getConnection();
        Statement statement = conn.createStatement();
        ResultSet result =statement.executeQuery(String.format(sql,parameters));
        // JDBC 的业务逻辑....
        return (T) result;
    }
}